package com.zgkxzx.java.mutilThread.dcl;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * 创建者 zgkxzx
 * 日期   1/11/18
 * 描述
 */

public class DCLTest {

    public static void test() {

        ExecutorService executorService =
                Executors.newCachedThreadPool();

        for (int i = 0; i < 20; i++)
            executorService.execute(new Runnable() {
                @Override
                public void run() {
                    int value = Singleston.getInstance().getValue();
                    System.out.println("Singleton value = " + value);
                }
            });


    }
}
